package com.fulihui.systemcore.api;

import org.near.servicesupport.request.TPageRequest;
import org.near.servicesupport.request.TRequest;
import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TMultiResult;
import org.near.servicesupport.result.TPageResult;
import org.near.servicesupport.result.TSingleResult;

import com.fulihui.systemcore.dto.ProjectDTO;
import com.fulihui.systemcore.request.project.ProjectEditRequest;
import com.fulihui.systemcore.request.project.ProjectQueryPageRequest;
import com.fulihui.systemcore.request.project.ProjectQueryRequest;
import com.fulihui.systemcore.request.project.QueryByCodeRequest;
import com.fulihui.systemcore.response.project.QueryResponse;

/**
 * 后台管理项目服务
 * @author leeson 2016年5月17日 下午3:10:27
 */
public interface ProjectService {

    /**
     * 通过code查询项目信息
     * @param request {@link QueryByCodeRequest}
     * @return {@link QueryResponse}
     */
    TSingleResult<QueryResponse> queryByCode(TRequest<QueryByCodeRequest> request);

    /**
     * 创建项目
     * @param request {@link ProjectEditRequest}
     * @return 服务调用结果 {@link BaseResult}
     */
    BaseResult create(TRequest<ProjectEditRequest> request);

    /**
     * 修改项目
     * @param request {@link ProjectEditRequest}
     * @return 服务调用结果 {@link BaseResult}
     */
    BaseResult update(TRequest<ProjectEditRequest> request);

    /**
     * 分页查询项目
     * @param request {@link ProjectQueryPageRequest}
     * @return 返回分页后项目模型 {@link ProjectDTO}
     */
    TPageResult<ProjectDTO> queryPage(TPageRequest<ProjectQueryPageRequest> request);

    /**
     * 按条件查询项目
     * @param request {@link ProjectQueryRequest}
     * @return 返回多个项目模型 {@link ProjectDTO}
     */
    TMultiResult<ProjectDTO> query(TRequest<ProjectQueryRequest> request);
}